import { selectLayout, setLayout as setLayoutDispatch } from "@/store/reducer/setupSlice";
import { shallowEqual, useDispatch, useSelector } from "react-redux";

export const useLayout = () => {
  const dispatch = useDispatch();
  const layout = useSelector(selectLayout, shallowEqual);
  const setLayout = (options: {}) => dispatch(setLayoutDispatch(options));
  return {
    layout,
    setLayout,
  };
};

export default useLayout;
